UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tP3qdAzxyHLp/FFDR4sTE20qX6yAJb/gmhyXlgoSabE='
WHERE
key_id = '4fba35289d686d1b5485d57f6e5b166f6df67bc5ed0ca30c87188337333f2f01'
AND (
token = 'tP3qdAzxyHLp/FFDR4sTE20qX6yAJb/gmhyXlgoSabE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)