UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YkIXE8jEY+VtILRlM1tnAPuDMNY06NUXohGZjsXsGh4='
WHERE
key_id = '0c02dde857338cb452b3c8dfc4e405e2de6fdf2aa02890ce4fee6bac4c589342'
AND (
token = 'YkIXE8jEY+VtILRlM1tnAPuDMNY06NUXohGZjsXsGh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)