UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SmZDDjKzDluRbCmnmRh5ttieTvORZtUnsPsW2gx8J/Q='
WHERE
key_id = 'f5bdd65a4ccb1da82c46f90d201cc42d5fc0f5f947a24943355b635a2d69185c'
AND (
token = 'SmZDDjKzDluRbCmnmRh5ttieTvORZtUnsPsW2gx8J/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)