UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IIoPWR/Lcgktmu8wkr5++EVyPhVEB5J8acRyIf6U3M0=' 
WHERE 
  key_id = 'dfa7b8f3744cba215550edeb23660bd1c2fa11bda15b1b0085996da47f26f37a' 
  AND (
    token = 'IIoPWR/Lcgktmu8wkr5++EVyPhVEB5J8acRyIf6U3M0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030