UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mSrKE4XAiQDVTro2QXbcGheLkhC3LB2G1CO8aZo6VBM=' 
WHERE 
  key_id = '5afdc49ffc9d0674e04accad5150cc23b068c495e5237ca6ff1d11931d8bd75b' 
  AND (
    token = 'mSrKE4XAiQDVTro2QXbcGheLkhC3LB2G1CO8aZo6VBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038