UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JVeiDNNHUt6Zdk8ReQ0T+kwA96l7OPBvNdmSVnQm1Xk=' 
WHERE 
  key_id = 'ec9ae3c1814d370b1fe4c1a25d960745d6a027380245c100bd2cca3fa6470ebf' 
  AND (
    token = 'JVeiDNNHUt6Zdk8ReQ0T+kwA96l7OPBvNdmSVnQm1Xk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027