UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9X5lXebCBVUQkvvPwrwb+mBosJYPjWrQyProzilAVQA='
WHERE
key_id = '8fd2e87af46ab674093bc843a0ac2670c8e5a98d633e1deee2e6e86981aa4b9a'
AND (
token = '9X5lXebCBVUQkvvPwrwb+mBosJYPjWrQyProzilAVQA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)