UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bEkSbMsB/HpyFy9GZRWCz/phJjuXAAq5uVmNkY3zeP8='
WHERE
key_id = '966b8d81a577ba65c26f83cdb63acf3255db1e08d0d5c1d43b4033849f35b493'
AND (
token = 'bEkSbMsB/HpyFy9GZRWCz/phJjuXAAq5uVmNkY3zeP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)