UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DrXles9oLc1rw2vK7OcO3QxWSnZEf1f3SonSrz+FJCE=' 
WHERE 
  key_id = '5477e33225b58c94368e8ee9a1c14f34313d375d7b5a6df6cf5bc35b4ffe219e' 
  AND (
    token = 'DrXles9oLc1rw2vK7OcO3QxWSnZEf1f3SonSrz+FJCE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041