UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gxA64stSxHFGxLtGkMtePmWKPzkbMWXSBo0mClqcd1k='
WHERE
key_id = '63c64b8139ff8c7970d6b877b19c9fbeb2eec5ac05955b23f97aef982eb5247b'
AND (
token = 'gxA64stSxHFGxLtGkMtePmWKPzkbMWXSBo0mClqcd1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)