UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '72pVeWtPi3fJBI3NtFkQq94ng8CHoraKvqGMQftTSoY=' 
WHERE 
  key_id = 'a0bedf6fa2f7257d2ec7a86dab43ecb428f472ba6ee8ae7dab55e17934341df2' 
  AND (
    token = '72pVeWtPi3fJBI3NtFkQq94ng8CHoraKvqGMQftTSoY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020