UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0CnvBVmgS7hF0b7M8EEulML+/22SB4nt1l2tyH9XD5E=' 
WHERE 
  key_id = '456be75282479316c964c55a38ac288124b94ffcb7d2a363378daa82cb5cb1b4' 
  AND (
    token = '0CnvBVmgS7hF0b7M8EEulML+/22SB4nt1l2tyH9XD5E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045