UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aVdmMcfctNS/JfY889Z225G0Pa6wlxePpI/1AALUv+4='
WHERE
key_id = 'b79b516bc198c6da6f7faa4618c2d2eea95dd53fc88b528d298b0eb3c5429c95'
AND (
token = 'aVdmMcfctNS/JfY889Z225G0Pa6wlxePpI/1AALUv+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)