UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k0xIC4Jb69S4WviZ1ntc2lYtSfMcCJT5eqtr4TQrfJc=' 
WHERE 
  key_id = 'dc74b767016a2a36f5f94be21b3088141aab6591ba8a7e9f94a5253555c1d0a9' 
  AND (
    token = 'k0xIC4Jb69S4WviZ1ntc2lYtSfMcCJT5eqtr4TQrfJc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056