UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/G9R6O50RmdhuHwzX5EfQtX8lNXGO9UvJrD7InvPGJo=' 
WHERE 
  key_id = 'c0684fda8aac5f3352def8832465ccc0bd80bf6159f05130feeed0e4f8821e8d' 
  AND (
    token = '/G9R6O50RmdhuHwzX5EfQtX8lNXGO9UvJrD7InvPGJo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029