UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JSRCC+BIjxr1PdogKyivM3r3uGVhVyQKjP23YZT68Z8='
WHERE
key_id = 'a2d1fac9f1c3ebf4eaf8ffe6a86d71438f3382317f41ebc319444b62bdcfdcdf'
AND (
token = 'JSRCC+BIjxr1PdogKyivM3r3uGVhVyQKjP23YZT68Z8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)