UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JFsbaOVGIZyuY5YyrbdE0Im7Qn/t4DlXnImVW5x/uhk='
WHERE
key_id = '5a194993da3c7627e25d9eea0385018535b454763e35ea447d1b34757bedb080'
AND (
token = 'JFsbaOVGIZyuY5YyrbdE0Im7Qn/t4DlXnImVW5x/uhk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)