UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ViUZP+fLYs/W5ux8pwUN/AM+iQF2bzSgVesniRNiyUM='
WHERE
key_id = 'b6214a968ec70a12c7b0e714624b68a2f6751fe253ce33bcf5d02c26279fa910'
AND (
token = 'ViUZP+fLYs/W5ux8pwUN/AM+iQF2bzSgVesniRNiyUM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)