UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1SKLz2PmDklYM9UXL+LdU6y1pFzKqkkdyPUgSGgzWZc='
WHERE
key_id = '982cf4f07d3afb6b693404b6e8b56a6e5c863e16c7756609896c04b8ea92935f'
AND (
token = '1SKLz2PmDklYM9UXL+LdU6y1pFzKqkkdyPUgSGgzWZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)