UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xH9yxuPN+6JYtM37mle075eAsUYAD1LUZK3G27XuIWM='
WHERE
key_id = '5d60d7e8a7b89e02301194d2e12f251bc74281caf3903e2c1da9e4c3943e711c'
AND (
token = 'xH9yxuPN+6JYtM37mle075eAsUYAD1LUZK3G27XuIWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)