UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VHRoVpAWaAKI66EpvEbWdW6AlGiTxh2F1+iB4Kw82dQ=' 
WHERE 
  key_id = '3b1e14e2f5da0e9c7e3876a852640b96c5b153f706d4b9b6866457bc366b5018' 
  AND (
    token = 'VHRoVpAWaAKI66EpvEbWdW6AlGiTxh2F1+iB4Kw82dQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033