UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PBT4L+IQcuUe6DramfR8TM5jQki6db1jXjrrscTmYHc='
WHERE
key_id = 'fe429dbf0957362e14421c638c7cbfdd3ac585b26a7252af1d9b8c3a38cbb569'
AND (
token = 'PBT4L+IQcuUe6DramfR8TM5jQki6db1jXjrrscTmYHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)