UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xl7NUlJYhUkxbBmLdI7KcQatUclnKZ6/gQFcF+8KtO8=' 
WHERE 
  key_id = '702dcf75b8ec5e4d7c8a8134d6ede19cf2747af22916bbb5970f06a15cf37eea' 
  AND (
    token = 'xl7NUlJYhUkxbBmLdI7KcQatUclnKZ6/gQFcF+8KtO8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020