UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zuEhaiQE3yyieJplUK541M9crWcsRuxeXiMLPOgzmM8='
WHERE
key_id = '3aba8064d63433ee358c42331f25e007b15204c38fa7a19eed8d79152ab0a7b3'
AND (
token = 'zuEhaiQE3yyieJplUK541M9crWcsRuxeXiMLPOgzmM8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)