UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DaqTbAZGRV2KJTYVBifH1nQv3TvbbBjGl6mpsc5TWlo=' 
WHERE 
  key_id = '5224ed9235c5473aaf59f37f1c753a07267f93c8ff9cc9d29b80c911427cef91' 
  AND (
    token = 'DaqTbAZGRV2KJTYVBifH1nQv3TvbbBjGl6mpsc5TWlo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039