UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HKyWpNRyg2TSMh0E8IX+suEyPjw0OpNouHpITrQC5nM='
WHERE
key_id = '1b0be545010f3af3fcba86564559c598d31599b3e171a08c6767db1af383f2c8'
AND (
token = 'HKyWpNRyg2TSMh0E8IX+suEyPjw0OpNouHpITrQC5nM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)