UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bMnbPLam9Xw0kR7UhSaS2SXrPRuONdgVhsQNaB64D/k='
WHERE
key_id = '9af59bc20c7d49319ec9735aa78b20256b2c764c6ffb4da4fc40d8aea8112cf4'
AND (
token = 'bMnbPLam9Xw0kR7UhSaS2SXrPRuONdgVhsQNaB64D/k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)