UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eg+HAbtDRsE3MTABdHpGRyxlRd7bR/a4AZ3Ch0F8JJU=' 
WHERE 
  key_id = '25dc10dda9780303e18e18877f2b7d90d64bd7ccf0ecfce4a07fb4470652a74c' 
  AND (
    token = 'eg+HAbtDRsE3MTABdHpGRyxlRd7bR/a4AZ3Ch0F8JJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027