UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l8ENr/i3XSyIH6odqhw3Eo/sZ5tCz+cigI36NzbMhOA=' 
WHERE 
  key_id = '4011e67bbf96cb551fc2968a6f43f72efd84e94cd6882a79e2f881b35ba47deb' 
  AND (
    token = 'l8ENr/i3XSyIH6odqhw3Eo/sZ5tCz+cigI36NzbMhOA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059