UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bee5YYEcd+uZp/yEd2xXLxZlH7tO0kK05cOXpPjOrMk='
WHERE
key_id = 'ceb4478326c7c520bb7e2d40cc593ef67d50b1b4b2fc2daf8fedb9fe12a840f6'
AND (
token = 'Bee5YYEcd+uZp/yEd2xXLxZlH7tO0kK05cOXpPjOrMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)