UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lk/yiufzopdkv0F/jn/P56bwf1qQAs6aQJ8rFz4hMw4='
WHERE
key_id = '19850146f88397196c7ab72ae64688e4c7028bf677c4e9d36a29830f94af09ac'
AND (
token = 'Lk/yiufzopdkv0F/jn/P56bwf1qQAs6aQJ8rFz4hMw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)