UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'weU2Jir68EleVe5ySTuDEqmcOEhVz6vCXhku5YiXQKw='
WHERE
key_id = 'b79cc36a8d276568e924ec9ce62431a2bdadc8063b8f61b19c0853f5f7a9fe11'
AND (
token = 'weU2Jir68EleVe5ySTuDEqmcOEhVz6vCXhku5YiXQKw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)