UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NHY/LwjvssKYVUxwb4h3Z42w7y6kimDNIzSF8bCZ0Cw=' 
WHERE 
  key_id = '7d1207a751dbe6cd9ded3fb34d81b609320bde35c55600b0fbe14bbc58bac905' 
  AND (
    token = 'NHY/LwjvssKYVUxwb4h3Z42w7y6kimDNIzSF8bCZ0Cw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030