UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2R/MHb2hq/vcRgoENKjNlFpBZuXa8EEEE4NIJvWrskc=' 
WHERE 
  key_id = '8807d482152b0d81005c1a295666a73e624f24092ca9b2b3bb50f4ee6118a076' 
  AND (
    token = '2R/MHb2hq/vcRgoENKjNlFpBZuXa8EEEE4NIJvWrskc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024