UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'olaFyh834D4N1EZsG8h1syY1Y6OJR5clvN0ozFRZR9Q=' 
WHERE 
  key_id = 'bcce2b911b21b145aae23db5939cbbac3051472f092dff4fcf99bbb533180042' 
  AND (
    token = 'olaFyh834D4N1EZsG8h1syY1Y6OJR5clvN0ozFRZR9Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062