UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZSZNwLcycML+i9G/NlHntmZkfpTShedp7Pc7t2jfXt0='
WHERE
key_id = '61c2bbaece061d071c6bc79363d206e4ed652c1fc9d58b37158c85c5552e8e06'
AND (
token = 'ZSZNwLcycML+i9G/NlHntmZkfpTShedp7Pc7t2jfXt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)