UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+7j/gAuZQPLHiPYziMoryqDBOwqDmVog+VDJKM16zQ='
WHERE
key_id = '8bbc6c8288962c3ff9c746c7e6e1da6c6035306557ec55730fc7178efec025a3'
AND (
token = '1+7j/gAuZQPLHiPYziMoryqDBOwqDmVog+VDJKM16zQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)