UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hmvXR4UytyhH7PU+I5h6F3AsVXGiZ7uQqhqogHrgbmc=' 
WHERE 
  key_id = '8e8ad8135b352c0b5a0d6f0fca302b3f7bf6d649bf047024647f1a11f2b5e84d' 
  AND (
    token = 'hmvXR4UytyhH7PU+I5h6F3AsVXGiZ7uQqhqogHrgbmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017