UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzVl6x1wm2rffvKUVarBFT3i5UEfCsYfR6oCEUlxu9M='
WHERE
key_id = 'e3650d809b5d99dcdb179b163c80355cb9539463b0c0e6881e47b783cb8ff7b7'
AND (
token = 'LzVl6x1wm2rffvKUVarBFT3i5UEfCsYfR6oCEUlxu9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)