UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjeLvrFc0lAxDpjaVmvlwuSOu/BUkEbowga454BFRqo=' 
WHERE 
  key_id = '98b0bd723139eb320bf65916d820b514e875c0fe0ef45225d1498a5f75ec1fc0' 
  AND (
    token = 'cjeLvrFc0lAxDpjaVmvlwuSOu/BUkEbowga454BFRqo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021