UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zuB6BZEEe/OlaDKKsIDozlizbBlpO87VjH4kV7+EEe8=' 
WHERE 
  key_id = '2a6a3d299a3347a543d8644fe66b6904d02715515d7108a6e41f647ac44d9572' 
  AND (
    token = 'zuB6BZEEe/OlaDKKsIDozlizbBlpO87VjH4kV7+EEe8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030