UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QHQxjFQKtYNltfH7e/Bqef+wjprlMqnQLdHG0ccRkw0='
WHERE
key_id = 'd90e44af6cc0bdd54b5e5306fea822b780b5eb6a3ef9e38892cf7e91e777e942'
AND (
token = 'QHQxjFQKtYNltfH7e/Bqef+wjprlMqnQLdHG0ccRkw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)