UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JFk7m9DPceVz9FTpvtkmsMklPkLfR/cjtMIKMXBxSco=' 
WHERE 
  key_id = '5a53811a0469fd3e5180cd00e721bee30105266ad650a67a40cead1bf9833a96' 
  AND (
    token = 'JFk7m9DPceVz9FTpvtkmsMklPkLfR/cjtMIKMXBxSco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037