UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPmUeHn9iGVyLS/Aa9UN3VkXrA+wS4ogC5AGrbtweR4='
WHERE
key_id = '8e794ea25cb402db0c6dbec41f9c93df7cbb6ea3d1a6f595569ac69242a4bdc1'
AND (
token = 'oPmUeHn9iGVyLS/Aa9UN3VkXrA+wS4ogC5AGrbtweR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)