UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mlrrUHNyn4ahx/77mTJ6YGgnNpO2u3GeKeueWVZudPI=' 
WHERE 
  key_id = '21e7557f6dec479e5f1f4ad33bddf99253a2e23fc0d9bd9bf375412d874f52c1' 
  AND (
    token = 'mlrrUHNyn4ahx/77mTJ6YGgnNpO2u3GeKeueWVZudPI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030