UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LFRbbG6HVv7k1Cz8g9GZY63kYJrkOnPM/Q3bEp91Izk=' 
WHERE 
  key_id = 'a962af086c9f56438ceb4bb9538332d6aaf9ccb30a95002a3b03fdaf3b0b193d' 
  AND (
    token = 'LFRbbG6HVv7k1Cz8g9GZY63kYJrkOnPM/Q3bEp91Izk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028