UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ca+ZowY2lTMYEUuIM0WtZtmeouO9AAPMml8Jf1rvsnY='
WHERE
key_id = 'f1775e3acc771c636aa572738f81e27b1533434c2304d18b7f08d314f0e73024'
AND (
token = 'Ca+ZowY2lTMYEUuIM0WtZtmeouO9AAPMml8Jf1rvsnY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)