UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e1Z+wGz+fV8ndXKWUP6Jljv8EuGAKi+NpL4+Xt/DAnc='
WHERE
key_id = '15aecd33ee63e389d50ca9b9d4db6a627192b4e4fa0046ad9535d715f01ec2f4'
AND (
token = 'e1Z+wGz+fV8ndXKWUP6Jljv8EuGAKi+NpL4+Xt/DAnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)