UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qsBgtpMK44/SAPQJscCsi4x3roH7KRS25+PGPcnxUVI='
WHERE
key_id = '420fa8cc0a8b193254e4ca7d3530a991d38836b8420caf60f4c3bc593e0f6b2b'
AND (
token = 'qsBgtpMK44/SAPQJscCsi4x3roH7KRS25+PGPcnxUVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)