UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3f25P+uk49rKUYMCv3zGhksgVMN9cpeoW1DEo76m4kY='
WHERE
key_id = '026bd766724c489cc8e91fe1414f55b501a480c06eddf8f3b61009813cf1a535'
AND (
token = '3f25P+uk49rKUYMCv3zGhksgVMN9cpeoW1DEo76m4kY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)