UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'doVpwjDfagXBMox1Af+Hre8zyRR2lgrlKLHVZ8XoQjc='
WHERE
key_id = '71ed5c0ab15faaf2138f8f92c49dc22d74afe6f0d761c7ac516b6216eeaeea1a'
AND (
token = 'doVpwjDfagXBMox1Af+Hre8zyRR2lgrlKLHVZ8XoQjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)