UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ETZ3bNv3vRgp1aeUQewwW7YZ/+ZwdoHGw6GVcv103Bg=' 
WHERE 
  key_id = 'dc9357af10d8cd868465f273bec80c2edc0b7d1f6ce5da9a4df2bfe56bf092b4' 
  AND (
    token = 'ETZ3bNv3vRgp1aeUQewwW7YZ/+ZwdoHGw6GVcv103Bg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024