UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Jg9mY1vlMdFLbe5JfxQBIm+AwBjiFkQn92Lul/J5PM='
WHERE
key_id = '0ae2c961de42844548d5f323546aceb4e08f0f7f41893d13e60c3b3de61c5527'
AND (
token = '0Jg9mY1vlMdFLbe5JfxQBIm+AwBjiFkQn92Lul/J5PM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)