UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b/OvTt7Gmd8Rev3/Z5v6tNwwQtcwqtBq9PcgY9GarGg=' 
WHERE 
  key_id = '34a935036365aed6d79f1f256736868eb4da8e67a3cb2892fe78ce5624fe3b9a' 
  AND (
    token = 'b/OvTt7Gmd8Rev3/Z5v6tNwwQtcwqtBq9PcgY9GarGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044